<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<title></title>
	<link rel="stylesheet" href="">
</head>
<body>
<script src="https://cdn.bootcss.com/vue/2.3.4/vue.js"></script>
<div id="root">
	<ele :name='name'></ele>
</div>
<script>
	Vue.component('ele',{
		
		render : function(h){
			var self = this;
			return h('div',[//子元素用数组抱起来
				h('child',{
					scopedSlots : {//作用域插槽
						default : function(prop){//方法传来一个props属性
							return [h('p',self.name),h('p',prop.text)]
						}
					}
				})
			])
		},
		props : ['name'],
	});
	Vue.component('child',{
		render : function(h){
			var self = this;
			return h('div',this.$scopedSlots.default({text:'你好啊,KEN'}))
		}
	})
	var vm = new Vue({
		el : "#root",
		data : {
			name : '来自父组件',
		}
	})
</script>
</body>
</html>